﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using KNXConnector.EIBD;
using System.Threading;

namespace TestingApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private ObjectController m_Controller;
        private void button1_Click(object sender, EventArgs e)
        {
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (m_Controller == null)
            {
                KNXConnector.Settings.SettingsReader settingsReader = new KNXConnector.Settings.SettingsReader();

                m_Controller = new ObjectController();
                m_Controller.HostName = "server2k8";
                m_Controller.Port = 6720;
                m_Controller.Start(settingsReader.GetAllObjects());
            }
            //m_Controller.GetKNXObject("ecl_appliques");
            m_Controller.SendKNXValue(this.txtID.Text, this.txtValue.Text);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
